package edu.upenn.seas.peerreview.smui.variants

import edu.upenn.seas.peerreview.{Id, Sink}

/**
 * Primitive bot that deterministically places ships in a row and shoots with
 * randomness (but consistency, having a fixed seed).
 */
class SillyBotDecider extends Decider {
  import scala.util.Random
  val rand = new Random(0)
  var boardSize : Point = null
  
  def placeShips(bSize:Point, shipSizes:List[Int]) : List[(Point,Point)] = {
    boardSize = bSize
    shipSizes.zipWithIndex.map(index_n_size =>
      (Point(0, index_n_size._2), Point(index_n_size._1, index_n_size._2)))
  }

  def makeMove(opps : List[Id]) : (Id, Point) =  (opps(rand.nextInt(opps.size)),
     Point(rand.nextInt(boardSize.x), rand.nextInt(boardSize.y)))
}
